import java.util.*;
/**
 * Created with IntelliJ IDEA.
 * Description: 统计回文，将s2整个插入到s1的各个位置中，判断是否能够满足条件
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            String s1 = sc.nextLine();
            String s2 = sc.nextLine();
            int count = 0;
            //暴力方法
            for(int i = 0; i < s1.length() + 1; i++) {
                StringBuilder sb = new StringBuilder();
                if(i == 0) {
                    sb.append(s2);
                    sb.append(s1);
                }else {
                    int j = 0;
                    for(; j < i; j++) {
                        sb.append(s1.charAt(j));
                    }
                    sb.append(s2);
                    for(; j < s1.length(); j++) {
                        sb.append(s1.charAt(j));
                    }
                }
                String tmp = sb.toString();
                int left = 0;
                int right = tmp.length() - 1;
                while(left < right) {
                    if(tmp.charAt(left++) != tmp.charAt(right--)) {
                        break;
                    }
                }
                if(left >= right) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
}
